import React,{Component} from "react"
import $ from "jquery"
export default class Answer extends Component{
	constructor(props){
		super(props)
		this.state={
			
		}
	}
	
	//点击评论人跳转到其他用户页面
	otheruser1(){
		let username=this.props.answer.anserUserName
		window.location="/user/"+username
	}
	
	//点击评论人跳转到其他用户页面
	otheruser2(){
		let username=this.props.commentusername
		window.location="/user/"+username
	}

	render(){
		return (
			<div>
				<p><span style={{color:"blue",cursor:"pointer"}} onClick={(e)=>this.otheruser1(e)}>{this.props.answer.anserUserName}</span>回复<span style={{color:"blue",cursor:"pointer"}} onClick={(e)=>this.otheruser2(e)}>{this.props.commentusername}</span>: <span style={{cursor:"pointer"}}>{this.props.answer.anserContent}</span></p>
			</div>
			
		)
	}
}